# 使用 PyMySQL（语法类似）
import pymysql

conn = pymysql.connect(
    host='localhost',
    user='root',
    password='yidong666',
    db='A3mall',
    port = 3306
)
cursor = conn.cursor()
# cursor.execute("SELECT * FROM 表名")
results = cursor.fetchall()
for row in results:
    print(row)

# 关闭连接
cursor.close()
conn.close()